home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / AmigaTalk_X / intuition / BOOPSIMethodIDs.st < prev    next >
Encoding:
Text File  |  2002-03-13  |  1.8 KB  |  51 lines

  1. " -------------------------------------------------------------------- "
  2. " MethodIDs Class is a Singleton class that allows the user to         "
  3. " reference BOOPSI Method IDs without having to remember their actual  "
  4. " hexadecimal values.                                                  "
  5. ""
  6. " The User does NOT need to create one of these, since Intuition Class "
  7. " will instantiate the only needed instance of this Class.  See the    "
  8. " SetupIntuition.st source file for the method(s) that help the User   "
  9. " with this Class.                                                     "
  10. ""
  11. " ALL singleton classes MUST contain the following:                    "
  12. ""
  13. "   the methods:  isSingleton AND privateSetup     AND                 "
  14. "                 uniqueInstance Class instance variable.              "
  15. " -------------------------------------------------------------------- "
  16.  
  17. Class MethodIDs :Dictionary ! uniqueInstance !
  18. [
  19.    isSingleton
  20.      ^ true  
  21. |  
  22.    privateNew ! newinstance !
  23.      newinstance <- super new.
  24.  
  25.      ^ newinstance
  26. |
  27.    new
  28.      ^ self privateSetup
  29. |
  30.    privateSetup
  31.      (uniqueInstance isNil)
  32.        ifTrue: [uniqueInstance <- self privateNew.
  33.  
  34.                 self at: #OM_Dummy     put: 16r100.
  35.  
  36.                 self at: #OM_NEW       put: 16r101.
  37.                 self at: #OM_DISPOSE   put: 16r102.
  38.                 self at: #OM_SET       put: 16r103.
  39.                 self at: #OM_GET       put: 16r104.
  40.                 self at: #OM_ADDTAIL   put: 16r105.
  41.                 self at: #OM_REMOVE    put: 16r106.
  42.                 self at: #OM_NOTIFY    put: 16r107.
  43.  
  44.                 self at: #OM_UPDATE    put: 16r108.
  45.                 self at: #OM_ADDMEMBER put: 16r109.
  46.                 self at: #OM_REMMEMBER put: 16r10A.
  47.                ].
  48.                
  49.      ^ self    "or ^ uniqueInstance??"
  50. ]
  51.